log: Display "(no subject)" for commits without a subject
authorMathnerd314 <mathnerd314.gph+hs@gmail.com>
Mon, 23 May 2016 18:52:56 +0000 (12:52 -0600)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 25 May 2016 18:37:47 +0000 (18:37 +0000)
This resolves the ambiguity for a message with a body but no subject,
and also hints that OSTree is using two bytes to store the empty
commit subject/body (when instead they could be stored, or rather,
not stored, as part of the metadata)

Closes: #305
Approved by: cgwalters

src/ostree/ot-dump.c

index 670ccd6aa30ada4424c905560764f910cbcaf988..48b087af9b2338dd22266303d14174485e006c36 100644 (file)
@@ -118,8 +118,15 @@ dump_commit (GVariant            *variant,
       g_print ("Version: %s\n", version);
     }
 
-  g_print ("\n");
-  dump_indented_lines (subject);
+  if (subject[0])
+    {
+      g_print ("\n");
+      dump_indented_lines (subject);
+    }
+  else
+    {
+      g_print ("(no subject)\n");
+    }
 
   if (body[0])
     {